
//
//  TopUpPreferentialCell.m
//  LuxuryGoods
//
//  Created by DCQ on 2018/5/24.
//  Copyright © 2018年 Future. All rights reserved.
//

#import "TopUpPreferentialCell.h"

@interface TopUpPreferentialCell()
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UILabel *numberLabel;
@property (weak, nonatomic) IBOutlet UIImageView *selectedImgV;
@property (weak, nonatomic) IBOutlet UILabel *preferentialNumber;

@end
@implementation TopUpPreferentialCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setupPreferentialSelected:(BOOL)selected{
    BOOL imgHidden = NO;
    UIColor *bgColor = nil;
    if (selected) {
        bgColor= UIColorFromRGB(0xFFEBC8);
        imgHidden = NO;
        
    }else{
         bgColor = [UIColor whiteColor];
        imgHidden = YES;
    }
    self.bgView.backgroundColor = bgColor;
     self.selectedImgV.hidden = imgHidden;
}

- (void)setupInfo:(NSDictionary *)info{
    
    self.numberLabel.text = [NSString stringWithFormat:@"￥ %@ ",info[@"price"]];
    if (info[@"give"] && [info[@"give"] integerValue] > 0) {
         self.preferentialNumber.text = [NSString stringWithFormat:@"  充值即送 ￥%@ ",info[@"give"]];
        self.preferentialNumber.hidden = NO;
    }else{
        self.preferentialNumber.hidden = YES;
    }
   
}
@end
